package com.TeamJigsaw.DanteTrail.Views;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionListener;

import javax.swing.*;

import com.TeamJigsaw.DanteTrail.Views.Interfaces.HuntingViewInterface;
import com.TeamJigsaw.DanteTrail.Models.Party;
import net.miginfocom.swing.MigLayout;

public class HuntingView extends JPanel implements HuntingViewInterface{
	
	private HuntingGameDisplay huntingGameDisplay;
	private JButton btnLeave;
	
	public HuntingView()
	{
		setSize(new Dimension(700,700));
		setLayout(new MigLayout("", "[50:50:50][grow][50:50:50]", "[50:50:50][grow][50:50:50][]"));
		
		
		
		
		btnLeave = new JButton("Leave");
		add(btnLeave, "cell 1 3,alignx center,aligny center");
		
	}

	@Override
	public void setLeaveListener(ActionListener listen) {
		btnLeave.addActionListener(listen);
		
	}

	@Override
	public void createHuntingGame(Party party, int level) {
		huntingGameDisplay = new HuntingGameDisplay(party, level);
		add(huntingGameDisplay, "cell 1 1,alignx center,aligny center");
		
	}
	
	@Override
	public void paintComponent(Graphics g) {
		ImageIcon img = new ImageIcon("resources\\stone_texture.jpg");
	    g.drawImage(img.getImage(), 0, 0, null);
	  }
	
	public HuntingGameDisplay getHuntDisplay()
	{
		return huntingGameDisplay;
	}

}
